<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<link href="style/kfyd.css" rel="stylesheet" type="text/css">
</head>
<?php
session_start();
$da=$_POST['da'];
$te=$_POST['te'];
$_SESSION['da']=$da;
$_SESSION['te']=$te;

//echo $_SESSION['da'].'<br/>';
//echo $_SESSION['te'].'<br/>';
?>
<body background="images/未标题-1.png">
<div id="z" align="center" style="margin:0 auto;">
	    <div id="header" align="center">
        <div id="logo"><table width="1200" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="250" height="250" style="font-size: 24px; color: #FC0;"><img src="images/logo.png" width="250" height="250"  alt=""/></td>
    <td width="362" style="font-size: 18mm; color: #FC0; text-align: center;"><p>广州W酒店</p></td>
    <td width="363" style="font-size: 24px; color: #FC0; text-align: center;"><p>Hotels W GuangZhou</p>
      <p>联系电话：400-699-8818<br>
        地址：广州天河区珠江新城冼村路26号</p>
      <p>（与金穗路交汇处）
               <?php
              session_start();
			  if($_SESSION["name"]==""){
				  echo "<a href='zcym.php'>注册</a>","<a href='dlym.php'>登陆</a>";
			  }
			  else{
					  echo "<a href='yhtc.php'>退出登陆</a>";
					  }
              ?>
 </p></td>
  </tr>
</table>
</div>
        <div id="dh">
          <table width="1200px" height="70px" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td style="text-align: center" width="171px"><a href="sy.php">首页</a></td>
              <td style="text-align: center"><a href="kfyd1.php" width="171px">客房预订</a></td>
              <td style="text-align: center"><a href="jdtp.php" width="171px">酒店图片</a></td>
              <td style="text-align: center"><a href="jdss.php">酒店设施</a></td>
              <td style="text-align: center"><a href="dtwz.php" width="171px">地图位置</a></td>
              <td style="text-align: center"><a href="zbhj.php" width="171px">周边环境</a></td>
              <td style="text-align: center"><a href="zkly.php" width="171px">住客留言</a></td>
            </tr>
          </table>
        </div>
            <div id="dt">
        <div id="c">
 		<table width="300" height="600" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top" style="font-size: 24px; text-align: left; color: #FC0;"><p>酒<span style="color: #FC0">店开业时间</span></p>
          <p><span style="color: #FC0">2013年03月</span></p>
                  <p>主楼高30层，</p>
          <p>客房总数317间（套）</p>
                <p> 客房WIFI免费，</p>
                <p>房间内高速上网，</p>
                <p>公共区WIFI免费，</p>
                <p>免费停车场 </p>
        </td>
  </tr>
</table>

        </div>     	<div id="d">
                  <table width="900" height="70" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td style="text-align: center; font-size: 24px; color: #FC0;">类型</td>
              <td style="text-align: center; font-size: 24px; color: #FC0;"><a href="kfyd.php?type=总统">总统</a></td>
              <td style="text-align: center; font-size: 24px; color: #FC0;"><a href="kfyd.php?type=豪华">豪华</a></td>
              <td style="text-align: center; font-size: 24px; color: #FC0;"><a href="kfyd.php?type=高级">高级</a></td>
              <td style="text-align: center; font-size: 24px; color: #FC0;"><a href="kfyd.php?type=商务">商务</a></td>
              <td style="text-align: center; font-size: 24px; color: #FC0;"><a href="kfyd.php?type=时尚">时尚</a></td>
            </tr>
          </table>
          <table width="900" height="50" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="180" style="text-align: center; font-size: 18px; color: #FC0;">排序</td>
    <td width="180" style="text-align: center; font-size: 18px; color: #FC0;">房间名</td>
    <td width="180" style="text-align: center; font-size: 18px; color: #FC0;">类型</td>
    <td width="180" style="text-align: center; font-size: 18px; color: #FC0;">价格</td>
    <td width="180" style="text-align: center; font-size: 18px; color: #FC0;">是否预定</td>
  </tr>
</table>

        <?php
		include("./conn/conn.php");
		$state="0";
		$type=$_GET[type];
		$page=$_GET[p];
		if($page==""){
		$page=1;}
		$num=6;
		$da=$_POST[da];
		$te=$_POST[te];
		/*if(p>1){
		if($da==""){
			echo("<script>alert('请输入入住时间！');window.location.href='kfyd1.php';</script>");
			}else if($te==""){
			echo("<script>alert('请输入离店时间！');window.location.href='kfyd1.php';</script>");
			}
		}*/
		if($type==""){
		    $sql="select * from tb_room where state=$state";
		    $sql_fy="select * from tb_room where state=$state limit ".($page-1)*$num.",".$num;
		} else {
		    $sql="select * from tb_room where state=$state and type='$type'";
			$sql_fy="select * from tb_room where state=$state and type='$type' limit ".($page-1)*$num.",".$num;
		}
		$result=mysqli_query($link,$sql);
		$rows=mysqli_num_rows($result);
		$to_pages=ceil($rows/$num);
		$result_fy=mysqli_query($link,$sql_fy);
		if(mysqli_num_rows($result_fy)>0){
			$i=1;
			?>
			<table width="900" height="50" border="0" cellspacing="0" cellpadding="0">
            <?php			
			while($vidoex_r=mysqli_fetch_assoc($result_fy))
			{$_SESSION['room']=$vidoex_r[name];
			?>
			 <form action="ydy.php" method="post" name="form1" id="form1">
             <tr>
				<td width="180" height="50" style="text-align: center; font-size: 18px; color: #FC0;"><?=$i?></td>
				<td width="180" style="text-align: center; font-size: 18px; color: #FC0;"><?=$vidoex_r[name]?></td>
				<td width="180" style="text-align: center; font-size: 18px; color: #FC0;"><?=$vidoex_r[type]?></td>
				<td width="180" style="text-align: center; font-size: 18px; color: #FC0;"><?=$vidoex_r[price]?></td>
			<!--<td width="180" style="text-align: center; font-size: 18px; color: #FC0;"><input type="submit" name="yd" id="submit" value="预定"></td>-->
                				<td width="180" style="text-align: center; font-size: 18px; color: #FC0;">
                                <a href="ydy.php?id=<?=$vidoex_r[name]?>">预定</a></td>
			  </tr>
              </form>
              <?php
				$i++;
				}
			}
		else{
			echo "无房间可预定。";
			}
		?>
</table>
<table width="600" height="50" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td align="center" valign="middle">第<?=$page?>页/共<?=$to_pages?>页</td>
    <td align="center" valign="middle"><a href="kfyd.php?p=1">首页</td>
    <td align="center" valign="middle"><a href="kfyd.php?p=<?=($page-1)?>">上一页</td>
    <td align="center" valign="middle"><a href="kfyd.php?p=<?=($page+1)?>">下一页</td>
    <td align="center" valign="middle"><a href="kfyd.php?p=<?=($to_pages)?>">尾页</td>
  </tr>
</table>

        </div>
    	<span style="text-align: center"></span>
        <div id="b">
          <p style="font-size: 24px; color: #FC0; text-align: center;">Copyright @ hotel-w.cn All rights reserved<br>
  中国•广州市　广州W酒店　Hotels W GuangZhou ICP备11101838号</p>

        </div>

</div>
</body>
</html>
